//package com.futao.springboot.learn.security.config;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.core.annotation.Order;
//import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
//import org.springframework.security.crypto.password.NoOpPasswordEncoder;
//import org.springframework.security.crypto.password.PasswordEncoder;
//
///**
// * 当项目比较复杂时，可以将配置写在多个配置中
// *
// * @author futao
// * Created on 2019-07-08.
// */
////@Configuration
//public class MultiWebSecurityConfig {
//
//    @Bean
//    public PasswordEncoder passwordEncoder() {
//        return NoOpPasswordEncoder.getInstance();
//    }
//
//    /**
//     * 配置用户名密码角色
//     *
//     * @param auth
//     * @throws Exception
//     */
//    @Autowired
//    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
//        auth
//                .inMemoryAuthentication()
//                .withUser("admin").password("nobug666").roles("admin", "user")
//                .and()
//                .withUser("DBA").password("DBA").roles("admin", "DBA")
//                .and()
//                .withUser("normal").password("123456").roles("user");
//    }
//
//    @Order(1)
//    @Configuration
//    public static class AdminWebSecurityConfig extends WebSecurityConfigurerAdapter {
//        @Override
//        protected void configure(HttpSecurity http) throws Exception {
//
//        }
//    }
//
//    @Order(2)
//    @Configuration
//    public static class DBAWebSecurityConfig extends WebSecurityConfigurerAdapter {
//        @Override
//        protected void configure(HttpSecurity http) throws Exception {
//
//        }
//    }
//
//    @Order(3)
//    @Configuration
//    public static class NormalWebSecurityConfig extends WebSecurityConfigurerAdapter {
//        @Override
//        protected void configure(HttpSecurity http) throws Exception {
//
//        }
//    }
//}